#pragma once

#include <iostream>

#include <opencv2/opencv.hpp>

typedef unsigned int uint;

class Tester
{
	int allPeople;
	int allDetected;
	int correctDetected;
	int extraDetected;
	int falseDetected;


	int GetRegions(cv::Mat &image, std::vector<uint> &labels);
	void PutLabel(cv::Mat &image, std::vector<uint> &labels, uint label, uint i, uint j);
	void Compare(int obj1, int obj2, std::vector<uint> lbl1, std::vector<uint> lbl2, cv::Mat im1, cv::Mat im2);


public:
	Tester() : allPeople(0), allDetected(0), correctDetected(0), extraDetected(0) {; }

	float GetRecall() { return float(correctDetected) / float(allPeople); }

	float GetAccuracy() { return float(correctDetected) / float(allDetected); }

	float GetFScore() 
	{ 
		float accuracy = GetAccuracy();
		float recall = GetRecall();
		
		return 2 * (accuracy * recall / (accuracy + recall)); 
	}

	void Compute(std::string groundThruth, std::string result, int first, int last);
};

